package ThreadReseau;
import java.io.IOException;
import Protocole.FluxEntrant;

/**
 * Create a thread that will read from a fluxEntrant while he is 'running' 
 */
public class ThreadEcouteur extends Thread
{	
	FluxEntrant fluxEntrant;
	public boolean running = true;
	
	public ThreadEcouteur(String nomCible, FluxEntrant fluxEntrant) throws IOException
	{
		super("Ecouteur "+nomCible);
		this.fluxEntrant = fluxEntrant;
	}
	
	public void run()
	{
		while(running)
		{
			fluxEntrant.lire();	
		}
	}

}
